//
//  NSAttributedString+XWKit.m
//  Tripvi
//
//  Created by xiaowuxiaowu on 2017/6/9.
//  Copyright © 2017年 xiaowuxiaowu. All rights reserved.
//

#import "NSAttributedString+XWKit.h"

@implementation NSAttributedString (XWKit)

+(NSMutableAttributedString *)tp_addText:(NSString *)text font:(NSFont *)font textColor:(UIColor *)color backgroundColor:(UIColor *)backgroundColor{

    
    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    
    if(font)
    [dic setObject:font forKey:NSFontAttributeName];
    
    if(color)
    [dic setObject:color forKey:NSForegroundColorAttributeName];
    
    if(backgroundColor)
    [dic setObject:backgroundColor forKey:NSBackgroundColorAttributeName];
    
    
    
    NSMutableAttributedString *attting = [[NSMutableAttributedString alloc]initWithString:text attributes:dic];
    
    
    
    return attting;
}
@end
